package cn.iocoder.yudao.module.infra.service.base;

import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils;
import cn.iocoder.yudao.module.infra.dal.dataobject.base.AmisDO;
import cn.iocoder.yudao.module.infra.dal.mysql.base.AmisMapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

@Service
public class AmisServiceImpl extends ServiceImpl<AmisMapper, AmisDO> implements AmisService {
    @Override
    public AmisDO getByType(String type) {
        ValidationUtils.validNotBeNull(type, "type");
        LambdaQueryWrapper<AmisDO> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.eq(AmisDO::getType, type);
        return this.getOne(queryWrapper);
    }
}
